using System;
using System.Threading.Tasks;

namespace Beeflys
{
    public interface IActorRef
    {
        ActorId Id { get; }

        bool IsActive { get; }
        
        void Send(object o, IActorRef source);
        
        void Call<TResponse>(object o, TimeSpan timeout, IActorRef source, ResponseDelegate<TResponse> completed);
        
        Task<ActorResult<TResponse>> CallAsync<TResponse>(object o, TimeSpan timeout, IActorRef source);
        
        MessengerOperator<TMessenger> Messenger<TMessenger>(IActorRef source, TimeSpan timeout) where TMessenger : IActorMessengerDefine;
    }
}
